#ifndef GAMEOBJECTPOOL_H
#define GAMEOBJECTPOOL_H

#include <QObject>
#include"gamedefine.h"
/*
 对象缓存池
*/

class GameObjectPool : public QObject
{
    GameObjectPool(QObject *parent = nullptr);
    static GameObjectPool *instance;
public:
    static GameObjectPool*Instance()
    {
        if(instance==nullptr)
        {
            return instance=new GameObjectPool;
        }
        return instance;
    }

    //对象池初始化
    void Init();

    //获取对象
    GameObject* GetGameObject(int _objectType);

    //对象回收
    void RecoveryGameObject(GameObject*_object);

    //内存清除
    void Clear();

protected:
    //掉落物对象池容器
    QList<Enemyfalling*> mFallingPool ;

};

#endif // GAMEOBJECTPOOL_H
